In this video we will learn how to calculate a stock's Alpha.
And we will also discover an alternative and more graphical explanation of a stocks paid factor.
And in the last video we have learned that there is a strong positive relationship between a stocks
the beta and the return.
And with the cap M formula we can calculate the required return of a stock given its systematic risk
in terms of the beta factor and in the optimal case that the stock is located here on the security market
line and returns exactly the cap m return.
However if you have a look at historical data then stocks can also be a buffer.
These security market line showing an over performance or below the security market line and showing
an underperformance and this over performance or underperformance is also the stocks alpha.
So for example here for our this nice stock the distance from the distance a stock to the security market
line is actually the stocks Alpha and in this example it's a negative.
So far these three stocks here we have a negative outlook for us and for the other stocks we have zero
alpha here because they are exactly located on the security market line and we actually have no stock
with positive alpha.
As we construct it the market portfolio in a way that this is the optimal portfolio based on the historical
data of these six stocks here and in the next video we will consider a more real world scenario where
we will also have positive and negative of stocks.
But for the time being we can go on here and we can simply calculate the alpha of each stock and we
are still imparted.
Our summary data frame and we've already learned that actually the alpha is the difference between the
actual return and the year required return.
According to the cap and model.
So we simply deduct our cap em return column from the uh return column and uh by doing so we're creating
a new column out of FA so let's do this and let's have a look here again.
Here we are on the right hand side we have now the alpha.
And we can see that for our three constituents of our market portfolio.
So the Amazon stock uh the Boeing stock and the Microsoft stock we have an outflow of uh 0 and uh 4.
The other three stocks uh where we have 0 8 in our market portfolio.
We have a negative 5 5 uh 3 percent 18 percent and still for the Coca-Cola stock minus 1 percent.
And by definition the alpha of the market portfolio is zero.
And last but not least we can also get an alternative more graphical intuition of these stocks beta
factor and we are still impart that the returns data frame with the daily returns of the stocks and
the market portfolio and we can actually get a stock sped up by having a linear regression between the
stocks returns and the returns of the market portfolio and we can do this graphically with a seaborne
joint plot.
So we are using other returns data frame and on the x axis.
We will have for the daily returns of the market portfolio and on the y axis we have the daily returns
of the Amazon stock.
So let's have a look
and we can clearly see that there is a strong positive relationship between returns of the market portfolio
and the Amazon returns.
So whenever the returns of the market portfolios are higher then also the return of the Amazon stock
is high and vice versa.
So here we have a linear regression and this is the regression line and we can actually describe a linear
regression with the two coefficients.
So we have the beta coefficient which is actually the slope of the regression line here and we have
actually the intercept and the beta factor that we calculated before is actually nothing else.
Then here the slope of the regression line so we can also calculate the slope of our regression line
here by performing the linear regression with an umpire and we can do this with the NPR dot poly fit
function.
Let's have a look here.
And here we have to pass um x values slowly he and our example the daily returns of the market portfolio
and y values.
So the daily returns of the Amazon stock.
And finally we have to determine a degree for the regression.
So here we have a linear regression with a degree of one so a quadratic regression would have a degree
of 2 and so on.
And uh that's running at the center and actually the NPD are poorly fed function returns.
Uh the coefficients of the regression and here at the index position zero.
So this is an umpire Ray at an exposition 0.
We have uh the beta of the regression to say the slope of the regression line and at the next position
1 we have the intercept.
Now we can also select the pater at index positions that are and save it and the available Amazon beta.
And this is exactly one point two to nine and we can also recall he our summary data frame where we
have also calculated the beta factor as being the normalized the systematic risk and also here we have
a value of 1 point 2 2 9.
So this is C around it but we have actually exactly the same value.
So this is a graphical intuition behind the beta effect to us.
So it's simply the regression slope between the particular stock and the market portfolio.
And with this we are finished here.
So we created here our summary data frame with lots of information of our six stocks.
So first of all we created the market portfolio which is actually the optimal portfolio for our six
stocks for the respective historical time period.
Then we calculated annualized risk and return.
And the sharp ratio then we divided the total risk into a systematic risk and and systematic risk.
And based on the systematic risk we calculated the normalized systematic risk which is the data then
we calculated the required return according to the cap and model which uh takes into consideration the
beta factor.
And finally we were able to calculate over our underperformance with the alpha and with this we are
finished here and I hope to see you also in the next video by.